import sys

sys.path.append("../lib")
from inner_util import prepare_dir, try_file_path

import pandas as pd

FUWUYE = [
    "多式联运和运输代理业",
    "装卸搬运和仓储业",
    "互联网和相关服务",
    "软件和信息技术服务业",
    "信息传输、软件和信息技术服务业",
    "房地产业",
    "租赁和商务服务业",
    "科学研究和技术服务业",
    "水利、环境和公共设施管理业",
    "居民服务、修理和其他服务业",
    "文化、体育和娱乐业",
]


def main():
    file_path = sys.argv[1]
    df = pd.read_excel(file_path, skiprows=1)
    # print("df", df[["行业", "占GDP比重（%）"]])

    a_df = df[["行业", "占GDP比重（%）"]]
    # 筛选列'A'的值在数组中的行
    filtered_df = a_df[a_df["行业"].isin(FUWUYE)]
    print(filtered_df)
    filtered_df.to_excel(try_file_path("res.xlsx"))

    pass


if __name__ == "__main__":
    main()
